Check frame width in a non-buggy way
authorBar Magal <barmagal@gmail.com>
Fri, 10 Jul 2015 17:57:34 +0000 (20:57 +0300)
committerBar Magal <barmagal@gmail.com>
Fri, 10 Jul 2015 17:57:34 +0000 (20:57 +0300)
`(window-width (frame-root-window))` throws an error when the frame is
split (frame's root window is not live).

which-key.el

index e0f335a4b8d12980cfbbc7f61ad79a13bd35ce76..6ff81dfc2e08506fbd943b09295bac5c8a79a75f 100644 (file)
@@ -524,7 +524,7 @@ of the intended popup."
    (if (member which-key-side-window-location '(left right))
        (which-key/total-width-to-text (which-key/width-or-percentage-to-width
                                        which-key-side-window-max-width))
-     (window-width (frame-root-window)))))
+     (frame-width))))
 
 (defun which-key/frame-max-dimensions ()
   (cons which-key-frame-max-height which-key-frame-max-width))